#ifndef DUNGEON_HPP_INCLUDED
#define DUNGEON_HPP_INCLUDED

#include <libtcod/libtcod.hpp>

#include "Zone.hpp"

enum EGenerationAlgo
{
	EGA_CELLULARAUTOMATA,
	EGA_BSP
};

class Dungeon: public Zone, public ITCODBspCallback
{
public:
	~Dungeon();

	void generate(std::string name, unsigned int numFloors, unsigned int width, unsigned int height, EGenerationAlgo algo);
	void saveToFile(std::string fileName);

private:
	TCODBsp* BSP;

	bool visitNode(TCODBsp* node, void* userData);
	
	void GenerateBsp(int roomsize, int subdivs);
	void GenerateCellularAutomata(unsigned int iterations, unsigned int percentWalls);
	void HorizontalLine(int x1, int x2, int y);
	void HorizontalLineLeft(int x, int y);
	void HorizontalLineRight(int x, int y);
	void VerticalLine(int x, int y1, int y2);
	void VerticalLineUp(int x, int y);
	void VerticalLineDown(int x, int y);
};

#endif
